<?php

class AccessLog  {

	public function save($log,$device){
	
		$version = 1; 	//Updated on 2012-jun-9
		$sql = 'INSERT DELAYED INTO access_logs (log,ver,device_id) VALUES (:log,:version,:device)'; //(\'' . $log . '\',$version);';
		try {
			$link = Yii::app()->db;
			$stmt = $link->createCommand($sql);
			$stmt->bindValue(':log',$log,PDO::PARAM_STR);
			$stmt->bindValue(':version',$version,PDO::PARAM_INT);
			$stmt->bindValue(':device',$device,PDO::PARAM_STR);
			$stmt->execute();		
		} catch(Exception $e) {
			error_log('Error al ejecutar sql='. $sql);
			var_dump($e);
		}
	
	}


}

